package com.youtills.action;

import javax.servlet.http.HttpServletRequest;

/**
 * TODO - !!!doc me!!!
 *
 * @author ravi.chiluveru
 * @since 23.0 (9/18/14)
 */
public interface ActionRequest {

    class Http implements ActionRequest {
        private final HttpServletRequest request;
        public Http(HttpServletRequest request) {
            this.request = request;
        }

        @Override
        public String getRequestParam(String paramName) {
            String[] values = request.getParameterValues(paramName);
            if(values != null && values.length > 0) {
                return values[0];
            }
            return null;
        }
    }

    String getRequestParam(String paramName);
}
